The present invention relates to an image processing method and apparatus and, more particularly, to an image processing method and apparatus for obtaining a desired image by performing interpolation operation for a two-dimensional image sensed by an image sensing apparatus such as an electronic camera.
To execute image processing such as enlargement/reduction with high quality for a two-dimensional image sensed by an image sensing apparatus such as an electronic camera, product-sum operation (convolution operation) using many pixels and high-order interpolation coefficients must be done as interpolation operation. At this time, a time spent for interpolation operation increases for a larger number of original pixels used or higher-precision interpolation coefficients. If the interpolation coefficient at a new pixel position different from the pixel position of an original image, i.e., at an interpolation position is calculated for every position, complicated operations increase, requiring a very long time.
Interpolation operation using a personal computer as post-processing for a sensed image is time-consuming. In an image sensing apparatus such as an electronic camera, however, long-time interpolation operation inhibits quickly checking a sensed image. In such a case, an image sensing apparatus such as a video camera that requires an image in real time is not suitable for practical use.
A stay-at-home type image processing apparatus which receives sufficient operation power from an AC power supply or the like can shorten the time of interpolation operation by using a high-speed processor at the cost of power consumption or a cost for a high-speed operation chip and memory. This solution, however, cannot be applied to a portable apparatus which receives only limited operation power.
To solve the above problem, various methods for simplifying interpolation operation have conventionally been proposed. For example, Japanese Patent Laid-Open No. 11-25067 discloses a method of calculating an interpolation coefficient at high speed. Japanese Patent Laid-Open No. 1-236867 discloses a method of calculating in advance the product of a pixel value at an original pixel and an interpolation coefficient at a pixel position for each partial region to which the enlarged pixel position belongs, and storing the product in a table.
In the former case, the conventional image processing method suffers low processing efficiency due to calculation of an interpolation coefficient every interpolation position. In the latter case, to reduce an approximation error, a region where an interpolation position is approximated is downsized, or the number of original pixels used for calculation is increased for higher-order interpolation operation. This results in a larger number of data calculated in advance and a larger memory area used to store a reference table.
Particularly in the latter case, interpolation operation is done using approximate points set by dividing the intervals between four adjacent original pixels, as shown in FIG. 13. In this case, a region 100 surrounded by four adjacent original pixels p(i,j) to p(i+1,j+1) deviates from an interpolation position range 101 which uses these four original pixels for interpolation operation.
For this reason, e.g., an interpolation position P(x,y) uses farther original pixels p(i+1,j) and p(i+1,j+1) for interpolation operation instead of original pixels p(i−1,j) and p(i−1,j+1) nearer the interpolation position. Depending on an original pixel value, a large error occurs in a pixel value obtained by interpolation operation. To solve this, an offset must be added (or subtracted) every calculation of an interpolation position, increasing the operation amount.